package org.dreamwork.cai.managed;

import org.dreamwork.injection.IObjectContext;
import org.dreamwork.cai.proxy.IServiceResolver;

public class ObjectContextResolver implements IServiceResolver {
    private IObjectContext context;
    private String localNamespace;

    @Override
    public Object get (String name) {
        return context.getBean (name);
    }

    @Override
    public <T> T get (Class<T> type) {
        return context.getBean (type);
    }

    @Override
    public String getLocalNamespace () {
        return localNamespace;
    }

    public void setLocalNamespace (String namespace) {
        this.localNamespace = namespace;
    }

    public void setContext (IObjectContext context) {
        this.context = context;
    }
}